package com.mjlf.shiro.login;

import com.mjlf.shiro.sha.HashService;
import org.apache.shiro.authc.credential.PasswordService;

/**
 * @ClassName ShiroPasswordService
 * @auther mjlf
 * @Date 2019/6/11 11:11
 * @Description TODO
 */
public class ShiroPasswordService implements PasswordService {
    @Override
    public String encryptPassword(Object o) throws IllegalArgumentException {
        return HashService.hash(o.toString(), "123");
    }

    @Override
    public boolean passwordsMatch(Object o, String s) {
        return HashService.hash(o.toString(), "123").equals(s);
    }
}
